/*
 * Modularity
 */

#include <cmath>
#include <iostream>
#include "ch03ex01.hpp"

double sqrt_sum(spar::Vector& v) {
    double sum = 0;
    for (int i = 0; i != v.size(); i++) sum += std::sqrt(v[i]);
    return sum;
}

int main() {
    using namespace spar;

    Vector v{2};
    v[0] = 11.2;
    v[1] = 0.1416;
    std::cout << v[0] << std::endl;
    std::cout << v[1] << std::endl;
    std::cout << sqrt_sum(v) << std::endl;

    return 0;
}
